﻿@using Web.Model;
@using Web.HelperClasses.Inflexion
@using Web.Entities.Enums

@helper Render(string data, string dummy)
	{
	<span>@(!String.IsNullOrEmpty(data) ? data : dummy)</span>
	}

@helper VacanciesString(IInflector inflector, Project p)
{
	int vacanciesCount = 3;
	String res = String.Join(", ", p.Vacancies.Where(x => x.NeedsMore).Take(vacanciesCount).Select(x => inflector.Inflect(x.Name, Case.Instrumental, true)));
	if (!String.IsNullOrEmpty(res))
	{
		res = "Вы можете стать " + res;
	}
	if (p.Vacancies.Count > vacanciesCount)
	{
		res += "...";
	}
	<p>@res</p>
}